﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Empires.RAL.Access
{
    public interface IAppUserAccess
    {
        /// <summary>
        /// 检查指定用户是否存在 存在返回1，否则返回0
        /// </summary>
        /// <param name="username"></param>
        /// <returns></returns>
        int UserIsExists(string username);
        /// <summary>
        /// 返回用户身份,如果不存在该用户，返回-1
        /// </summary>
        /// <param name="username"></param>
        /// <returns></returns>
        int GetUserStatus(string username);
        /// <summary>
        /// 获取用户对象
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="username"></param>
        /// <returns></returns>
        T GetUserEntity<T>(string username) where T : class;
        /// <summary>
        /// 新用户注册
        /// </summary>
        /// <param name="username"></param>
        /// <param name="password"></param>
        /// <param name="sex"></param>
        /// <param name="age"></param>
        /// <param name="contact"></param>
        /// <param name="appellaction"></param>
        /// <param name="adress"></param>
        /// <returns></returns>
        int NewUserRegister(string username, string password, string nickname, bool sex, DateTime birthday, string contact, string appellaction, string adress);
        /// <summary>
        /// 锁定一个用户
        /// </summary>
        /// <param name="username"></param>
        /// <returns></returns>
        int LockUser(string username);
        /// <summary>
        /// 更新用户信息
        /// </summary>
        /// <param name="username"></param>
        /// <param name="password"></param>
        /// <param name="sex"></param>
        /// <param name="age"></param>
        /// <param name="contact"></param>
        /// <param name="appellaction"></param>
        /// <param name="address"></param>
        /// <returns></returns>
        int UpdateUserInfo(string username, string password, bool sex,  DateTime birthday, string contact, string appellaction, string address);
        /// <summary>
        /// 获取昵称
        /// </summary>
        /// <param name="username"></param>
        /// <returns></returns>
        string GetUserNickname(string username);
    }
}
